package com.css.zfzx.sjcj.modules.hddcMainAFSvyRegion.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcMainAFSvyRegion.repository.entity.HddcMainafsvyregionEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zyb
 * @date 2020-12-14
 */
public interface HddcMainafsvyregionRepository extends JpaRepository<HddcMainafsvyregionEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_mainafsvyregion set qualityinspection_status=:s ,extends1=:str where uuid=:uuid")
    void updateStatus(String s, String str, String uuid);
    @Query(nativeQuery = true,value = "select m.* from hddc_mainafsvyregion m where m.id=?1 and m.is_valid=1")
    HddcMainafsvyregionEntity finbyId(String id);

    @Query(nativeQuery = true,value = "select * from hddc_mainafsvyregion where is_valid=1 and extends10=1 ")
    List<HddcMainafsvyregionEntity> findByAll();

    HddcMainafsvyregionEntity findByUuidAndIsValid(String id, String isValid);
}
